

package jetbrains.buildServer.server.graphql.model;

import jetbrains.buildServer.server.graphql.util.ObjectIdentificationNode;
import jetbrains.buildServer.serverSide.SBuildAgent;
import org.jetbrains.annotations.NotNull;

public class Agent implements ObjectIdentificationNode {
  @NotNull
  private final SBuildAgent myRealAgent;

  public Agent(@NotNull SBuildAgent realAgent) {
    myRealAgent = realAgent;
  }

  @Override
  @NotNull
  public String getRawId() {
    return Integer.toString(myRealAgent.getId());
  }

  @NotNull
  public String getName() {
    return myRealAgent.getName();
  }

  public boolean isAuthorized() {
    return myRealAgent.isAuthorized();
  }

  public boolean isEnabled() {
    return myRealAgent.isEnabled();
  }

  public boolean isConnected() {
    return myRealAgent.isRegistered();
  }

  @NotNull
  public SBuildAgent getRealAgent() {
    return myRealAgent;
  }
}